<?php
	session_start();
	function login($found)
	{
		$_SESSION["user_id"] = mysql_result($found, 0, 0);
		$_SESSION["user_name"] = mysql_result($found, 0, 1);
	}
	function isLoggedIn()
	{
		if(isset($_SESSION["user_id"]))
			return true;
		else
			return false;
	}
	function getUserId()
	{
		return $_SESSION["user_id"];
	}
	function getUserName()
	{
		return $_SESSION["user_name"];
	}
	function logout()
	{
		if(isset($_SESSION["user_id"]))
		{
			unset($_SESSION["user_id"]);
			unset($_SESSION["user_name"]);
		}
	}
?>